package com.njtoyo.taxi.admin.logic.business.ride;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.njtoyo.taxi.admin.mapper.master.entity.Account;
import com.njtoyo.taxi.admin.mapper.master.mapper.AccountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountLogic {

    @Autowired
    private AccountMapper accountMapper;

    /**
     * 根据乘客id获取account
     */
    public Account getByCustomerId(Long customerId) {
        return new LambdaQueryChainWrapper<>(accountMapper)
                .eq(Account::getCustomerId, customerId)
                .one();
    }

}
